xen: do not free reserved memory into heap
authorPenny Zheng <Penny.Zheng@arm.com>
Tue, 6 Sep 2022 07:39:14 +0000 (15:39 +0800)
committerJulien Grall <jgrall@amazon.com>
Tue, 6 Sep 2022 16:53:34 +0000 (17:53 +0100)
commitd58b6aef96968facad5867513fdca262c68d48a4
tree80fad31629a8fc4020d83605f5a9fd351bc2a2ae
parent654f406d510a71e588b481a11434ed955d008be8
xen: do not free reserved memory into heap

Pages used as guest RAM for static domain, shall be reserved to this
domain only.
So in case reserved pages being used for other purpose, users
shall not free them back to heap, even when last ref gets dropped.

This commit introduces a new helper free_domstatic_page to free
static page in runtime, and free_staticmem_pages will be called by it
in runtime, so let's drop the __init flag.

Wrapper #ifdef CONFIG_STATIC_MEMORY around function declaration(
free_staticmem_pages, free_domstatic_page, etc) is kinds of redundant,
so we decide to remove it here.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/include/asm/mm.h
xen/arch/arm/mm.c
xen/common/page_alloc.c
xen/include/xen/mm.h